#include "testlib.h"
#include <iostream>
#include <cstdio>


const int N = 30 + 5;
int g[N], a[N];
int n, m;


void YES() {
    quitf(_ok, "The ans is correct.");
}
void NO() {
    quitf(_wa, "The ans is not correct.");
    exit(0);
}



void readInf() 
{
    n = inf.readInt();
    m = inf.readInt();
    for (int i = 1; i <= n; i++)
        g[i] = inf.readInt();

}

int userans, A[N];
int sum;
void readOuf() 
{
    userans = ouf.readInt();
    for (int i = 1; i <= n; i++)
        A[i] = ouf.readInt(1, m - n + 1), sum += A[i];
}

int Ans, B[N];
void readAns() 
{
    Ans = ans.readInt();
    for (int i = 1; i <= n; i++)
        B[i] = ans.readInt();
}

// main 需要接收命令行参数

int main(int argc, char *argv[])
{
    // 初始化 checker 环境 —— 解析命令行参数、打开文件……
    registerTestlibCmd(argc, argv);

    // 三个全局变量 inf, ouf, ans 依次为输入、选手输出和参考输出
    

    readInf();
    readOuf();
    readAns();

    if (userans != Ans) NO();
    if (sum != m) NO();

    for (int i = 1; i <= n; i++)
    {
        for (int j = 1; j <= n; j++)
        {
            if(A[j] > A[i]) a[i]++;
        }
    }
    long long tot = 0;
    for (int i = 1; i <= n; i++)
        tot += g[i] * a[i];

    if (tot != Ans) NO();
    YES();

    return 0;
}